add_executable(meaner3
	meaner3.cc include/meaner3.h
	tmeaner.cc include/tmeaner.h
	tparcook.cc include/tparcook.h
	tsaveparam.cc include/tsaveparam.h
	texecute.cc include/texecute.h
	texecsect.cc include/texecsect.h
	texecalarm.cc include/texecalarm.h
	tstatus.cc include/tstatus.h
	twriter.cc include/twriter.h
	include/classes.h
)

target_include_directories(meaner3
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(meaner3
	PRIVATE
		Szarp2
)

add_executable(peakator
   utils/peakator.cc
   tsaveparam.cc include/tsaveparam.h
   tstatus.cc include/tstatus.h
)

target_include_directories(peakator
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(peakator
	PRIVATE
		Szarp2
)

add_executable(prober
  fileremover.cc tparcook.cc tsaveparam.cc twriter.cc
  tprober.cc tstatus.cc prober.cc
)

target_include_directories(prober
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(prober
	PRIVATE
		Szarp2
)

add_executable(szbedit
  utils/szbedit.cc
)

target_include_directories(szbedit
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(szbedit
	PRIVATE
		Szarp2
		newt
)

add_executable(extrszb
  utils/extrszb.cc
)

target_include_directories(extrszb
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(extrszb
	PRIVATE
		Szarp2
)

add_executable(szbindex
  utils/szbindex.cc
)

target_include_directories(szbindex
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(szbindex
  PRIVATE
    Szarp2
)

add_executable(szbreader
  utils/szbreader.cc
)

target_include_directories(szbreader
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(szbreader
  PRIVATE
    Szarp2
)

add_executable(szbwriter
  utils/szbwriter.cc
	utils/szbwriter_cache.cc include/szbwriter_cache.h
  utils/tmmapparam.cc include/tmmapparam.h
	tsaveparam.cc include/tsaveparam.h
	tstatus.cc include/tstatus.h
)

target_include_directories(szbwriter
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(szbwriter
  PRIVATE
    Szarp2
)

add_executable(szbndremover
  utils/szbndremover.cc
	tsaveparam.cc include/tsaveparam.h
	tstatus.cc include/tstatus.h
)

target_include_directories(szbndremover
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(szbndremover
  PRIVATE
    Szarp2
)

add_executable(szbmod
  utils/szbmod.cc
	tsaveparam.cc include/tsaveparam.h
	tstatus.cc include/tstatus.h
)

target_include_directories(szbmod
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(szbmod
  PRIVATE
    Szarp2
)

add_executable(szbnull
  utils/szbnull.cc
)

target_include_directories(szbnull
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(szbnull
	PRIVATE
		Szarp2
)

add_executable(checker
  utils/checker.cc
)

target_include_directories(checker
  PUBLIC
    ${LUA_INCLUDE_DIR}
  PRIVATE
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_link_libraries(checker
	PRIVATE
		Szarp2
	INTERFACE
		${LUA_LIBRARIES}
)

install(TARGETS
  checker meaner3 peakator prober szbedit extrszb szbindex szbreader
  szbwriter szbndremover szbmod szbnull
  RUNTIME DESTINATION "${INSTALL_BINDIR}" DESTINATION bin)
